/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aiaudio.database.tablegroup;

import aiaudio.lastfm.hbase.CannotCreateTableException;
import aiaudio.database.DatabaseStorage;
import aiaudio.database.tables.TableStructure;
import java.io.IOException;

/**
 *
 * @author nastya
 */
public abstract class TableGroup {

    protected String key;
    protected boolean dropIfExists;

    public TableGroup(String key, boolean dropIfExists) {
        this.key = key;
        this.dropIfExists = dropIfExists;
    }

    protected void createTable(DatabaseStorage storage, String tableName, TableStructure structure) throws CannotCreateTableException, IOException {
        storage.createTable(tableName, structure, dropIfExists);
    }

    protected String addKey(String name){
        return key + "_" + name;
    }
    
    public abstract void create(DatabaseStorage storage) throws CannotCreateTableException, IOException;
}
